<template>
  <div class="listViewTop">
    <img class="listViewTopBg" :src="playlist.coverImgUrl" alt="" />
    <div class="listViewTopNav">
      <div class="back" @click="handleBack">
        <i class="iconfont icon-zhixiangzuo"></i>
        <div class="title">
          歌单
          <i class="iconfont icon-R_round"></i>
        </div>
      </div>
      <div class="right">
        <div class="search">
          <i class="iconfont icon-sousuo"></i>
        </div>
        <div class="more">
          <i class="iconfont icon-gengduo"></i>
        </div>
      </div>
    </div>
    <div class="content">
      <div class="contentLeft">
        <img :src="playlist.coverImgUrl" />
        <div class="count">
          <i class="iconfont icon-24gl-play"></i>
          {{ playlist.playCount }}
        </div>
      </div>
      <div class="contentRight">
        <h3>{{ playlist.name }}</h3>
        <div class="author">
          <img :src="playlist.creator.avatarUrl" alt="" class="authorAvatar" />
          <span class="nickName">
            {{ playlist.creator.nickname }}
            <i class="iconfont icon-xiangyoujiantou"></i>
          </span>
        </div>
        <div class="description">
          <span>{{ playlist.description }}</span>
          <i class="iconfont icon-xiangyoujiantou"></i>
        </div>
      </div>
    </div>
    <div class="iconList">
      <div class="iconItem">
        <i class="iconfont icon-pinglun"></i>
        <span>{{ playlist.commentCount }}</span>
      </div>
      <div class="iconItem">
        <i class="iconfont icon-fenxiang"></i>
        <span>{{ playlist.shareCount }}</span>
      </div>
      <div class="iconItem">
        <i class="iconfont icon-xiazai">
          <i class="iconfont icon-tipvip"></i>
        </i>
        <span>下载</span>
      </div>
      <div class="iconItem">
        <i class="iconfont icon-xuanze-duoxuan-tianchong"></i>
        <span>多选</span>
      </div>
    </div>
  </div>
</template>

<script>
import { useRouter } from "vue-router";
export default {
  name: "listViewTop",
  props: ["playlist"],
  setup(props) {
    const router = useRouter();
    const handleBack = () => {
      router.back();
    };
    console.log(props);
    return { handleBack };
  },
};
</script>

<style lang="less" scoped>
.listViewTop {
  width: 7.5rem;
  padding: 0 0.4rem;
  .listViewTopBg {
    position: fixed;
    left: 0;
    top: 0;
    width: 100%;
    height: auto;
    z-index: -1;
    filter: blur(40px);
  }
  .listViewTopNav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 1.2rem;
    font-size: 0.4rem;
    color: #fff;

    .iconfont {
      font-size: 0.45rem;
    }
    .back {
      display: flex;
      align-items: center;
      .title {
        position: relative;
        margin-left: 0.3rem;
        .icon-R_round {
          position: absolute;
          right: -0.24rem;
          top: 0;
          font-size: 0.28rem;
          color: rgb(230, 224, 224);
        }
      }
    }
    .right {
      display: flex;
      align-items: center;

      .more {
        .icon-gengduo {
          font-size: 0.65rem;
          margin-left: 0.3rem;
        }
      }
    }
  }

  .content {
    display: flex;
    justify-content: space-between;
    margin-top: 0.5rem;

    .contentLeft {
      position: relative;
      .count {
        display: flex;
        align-items: center;
        position: absolute;
        top: 0.1rem;
        right: 0.1rem;
        color: #fff;
        font-size: 0.26rem;

        .icon-24gl-play {
          font-size: 0.2rem;
        }
      }
      img {
        width: 2.5rem;
        height: 2.5rem;
        border-radius: 0.1rem;
      }
    }

    .contentRight {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      margin-left: 0.2rem;
      h3 {
        color: #fff;
        font-size: 0.35rem;
      }
      color: rgb(207, 204, 204);
      .author {
        display: flex;
        align-items: center;
        .authorAvatar {
          width: 0.5rem;
          height: 0.5rem;
          border-radius: 50%;
        }

        .nickName {
          display: flex;
          align-items: center;
          padding-left: 0.1rem;
          font-size: 0.26rem;

          .iconfont {
            font-size: 0.24rem;
          }
        }
      }

      .description {
        display: flex;
        justify-content: space-between;
        align-items: center;
        font-size: 0.26rem;
        .iconfont {
          font-size: 0.24rem;
        }
        span {
          overflow: hidden;
          text-overflow: ellipsis;
          display: -webkit-box;
          -webkit-line-clamp: 2;
          -webkit-box-orient: vertical;
        }
      }
    }
  }

  .iconList {
    display: flex;
    justify-content: space-around;
    margin-top: 0.4rem;
    color: #eee;
    .iconItem {
      display: flex;
      flex-direction: column;
      align-items: center;

      .icon-xiazai {
        position: relative;
        z-index: 2;
        .icon-tipvip {
          position: absolute;
          right: -6px;
          bottom: -5px;
          overflow: hidden;
          font-size: 0.3rem;
          z-index: 999;
        }
      }
      .iconfont {
        font-size: 0.4rem;
      }

      span {
        margin-top: 0.1rem;
        // color: #eee;
        font-size: 0.26rem;
      }
    }
  }
}
</style>
